package com.ruoyi.GroupControl.controller;

import com.ruoyi.GroupControl.domain.Group;
import com.ruoyi.GroupControl.service.IGroupService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.poi.ExcelUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

@RestController
@RequestMapping("/Group/group")
public class GroupController extends BaseController
{
    @Autowired
    private IGroupService groupService;

    /*查询*/
    @GetMapping("/list")
    public TableDataInfo list() {
        startPage();
        List<Group> list = groupService.getLatestWldData();
        return getDataTable(list);
    }

//    /*获取*/
//    @GetMapping(value = "/{ID}")
//    public AjaxResult getInfo(@PathVariable("ID") Long ID)
//    {
//        return success(groupService.selectChaoSiById(ID));
//    }
//
//    /*导出*/
//    @PostMapping("/export1")
//    public void export1(Long[] ids,HttpServletResponse response)
//    {
//       List<Group> list = groupService.selectChaoSiByIds(ids);
//        groupService.exportByTemplate1(list,response);
//    }
//
//    @PostMapping("/export2")
//    public void export2(Long[] ids,HttpServletResponse response)
//    {
//        List<Group> list = groupService.selectChaoSiByIds(ids);
//        groupService.exportByTemplate2(list,response);
//    }
//    /*根据id来导出全部*/
//    @PostMapping("/export3")
//    public void export3(Long[] ids,HttpServletResponse response)
//    {
//        List<Group> list = groupService.selectChaoSiByIds(ids);
//        ExcelUtil<Group> util = new ExcelUtil<Group>(Group.class);
//        util.exportExcel(response, list, "数据");
//    }
//    /*导出全部，默认全选*/
//    @PostMapping("/exportAll")
//    public void exportAll(Group group, HttpServletResponse response)
//    {
//        List<Group> list = groupService.selectChaoSiList(group);
//        ExcelUtil<Group> util = new ExcelUtil<Group>(Group.class);
//        util.exportExcel(response, list, "数据");
//    }
//    /*导出2全部，默认全选*/
//    @PostMapping("/exportAll2")
//    public void exportAll2(Group group, HttpServletResponse response)
//    {
//        List<Group> list = groupService.selectChaoSiList(group);
//        groupService.exportByTemplate3(list,response);
//    }
    
}